package cn.openea.perpartner.componet.web.mapper;

import cn.openea.perpartner.componet.web.entity.InsMsg;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 消息对象表数据库访问层
 * @author Weird077
 * @since 2023-02-03 12:17:57
 */
@Repository
public interface MsgMapper extends BaseMapper<InsMsg> {

    @Select("select * from (select * from component_msglist union all select * from component_hismsglist) m  ${ew.customSqlSegment}")
    List<InsMsg> selectAllList(@Param("ew") QueryWrapper queryWrapper);

    @Select("select count(0) from (select * from component_msglist union all select * from component_hismsglist) m  ${ew.customSqlSegment}")
    Long selectAllCount(@Param("ew") QueryWrapper queryWrapper);
}

